package main;

import com.csvreader.CsvReader;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;

public class csvopt {

    public static void main(String[] args) {

        try {
            ArrayList<String[]> csv=new ArrayList<String[]>();

            String csvPath="C:\\Users\\dinstar\\Desktop\\bill2.csv";

            CsvReader csvReader=new CsvReader(csvPath,',', Charset.forName("UTF-8"));
            //csvReader.readHeaders();

            while (csvReader.readRecord()){
               // System.out.println(csvReader.getRawRecord()+"||||||");
                csv.add(csvReader.getValues());
            }
            csvReader.close();

           for(int i=0;i<csv.size();i++){
               String[] cell=csv.get(0);
                for (String temp:cell
                     ) {
                    System.out.print("--->"+temp);
                }
            }
              //  System.out.println("------>"+cell);
/*                for (String temp:csv.get(i)) {
                    System.out.print("-->"+temp);
                }
                System.out.println();*/







        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
